﻿<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <title>数据库配置</title>
    <script type="text/javascript" src="../Content/highlighter/scripts/shCore.js"></script>
    <script type="text/javascript" src="../Content/highlighter/scripts/shBrushXml.js"></script>
    <link type="text/css" rel="stylesheet" href="../Content/highlighter/styles/shCoreDefault.css"/>
    <script type="text/javascript">SyntaxHighlighter.all();</script>
</head>
<body>
	<h3>数据库配置</h3>
    <p>
    1.配置Web.Config中的ConnectionString
    </p>
    mysql数据库:
    <pre class="brush: xml;">
    &lt;connectionStrings&gt;
    &lt;add name="tiaojiu" connectionString="Server=localhost;Database=tiaojiu;Uid=root;Pwd=password;" providerName="MySql.Data.MySqlClient" /&gt;
    &lt;/connectionStrings&gt;
    </pre>
    sqlite数据库:
    <pre class="brush: xml;">
    &lt;connectionStrings&gt;
    &lt;add name="abc" connectionString="DataSource=D:\webApp\Da-net\weixin\wedongli\choujiang_test\data\abc.db;Pooling=true;FailIfMissing=false" providerName="System.Data.SQLite" /&gt;
    &lt;/connectionStrings&gt;
    </pre>
    sqlserver数据库:
    <pre class="brush: xml;">
    &lt;connectionStrings&gt;
    &lt;add name="dtcmsdb3" connectionString="Server=.\SQLEXPRESS;Database=DTcmsdb3;Uid=sa;Pwd=password;" providerName="System.Data.SqlClient" /&gt;
    &lt;/connectionStrings&gt;
    </pre>
    oracle数据库:
    <pre class="brush: xml;">
    &lt;connectionStrings&gt;
    &lt;add name="dada" connectionString="Data Source==(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=127.0.0.1)(PORT=1521)))(CONNECT_DATA=(SERVICE_NAME=DADA)));User Id=sa;Password=password;" providerName="Oracle.ManagedDataAccess.Client" /&gt;
    &lt;/connectionStrings&gt;
    </pre>
    <p>
    2.运行WebCompile.aspx生成数据库操作类.
    </p>
    <p>
    3.打开Models目录,显示所有文件,把生成的数据库操作类添加进项目中.
    </p>
</body>
</html>
